<!DOCTYPE HTML>
<html>
<head>
    <title>学科竞赛成绩管理系统登录</title>
    <meta charset="utf-8">
    <style>
			.main_bar{
				width:1350px;
				height:350px;
				background-color:#6495ED;
				margin-top:10%;
			}
			#login_form{
				width:40%;
				height:100%;
				background-color:#112435;
				margin:0 auto;
			}
			.title{
				width:100%;
				height:55px;
				color:#ffffff;
				border-bottom:1px solid #ffffff;
				font-size:20pt;
				font-family:"微软雅黑";
				line-height:55px;
				text-align:center;
			}
			#form_widget{
				width:100%;
				height:295px;
				background-color:#808080;
			}
			.txt{
				display:block;/*设置为独立块（换行）*/
				width:70%;
				margin:0 auto;
				height:35px;
				font-size:15pt;
				border-radius:5px;/*设置圆角样式*/
				border:0;
				padding-left:8px;
			}
			#vcode{
				height:35px;
				width:40%;
				font-size:15pt;
				margin-left:15%;
				border-radius:5px;
				border:0;
				padding-left:8px;
			}
			#code{
				color:#ffffff;/*字体颜色白色*/
				background-color:#000000;
				font-size:20pt;
				font-family:"华康娃娃体W5";
				padding:5px 35px 10px 35px;
				margin-left:5%;
				cursor:pointer;
			}
			#search_pass_link{
				width:70%;
				text-align:right;
				margin:0 auto;
				padding:5px;
			}
			/*层级选择器*/
			#search_pass_link a{
				color:#000000;
				text-decoration:none;
			}
			/*伪类*/
			#search_pass_link a:hover{
				color:#ff0000;
				text-decoration:underline;
			}
			.btn{
				width:70%;
				margin-left:15%;
				height:40px;
				border:0;
				font-size:14pt;
				font-family;"微软雅黑";
				background-color:#FC5628;
				color:#ffffff;
				cursor:pointer;/*设置指针鼠标的样式*/
				border-radius:20px;/*设置圆角样式*/
				border:0;
			}
			#copyright{
				width:100%;
				text-align:center;
				padding-top:20px;
				font-family:"微软雅黑";
				color:#e0e0e0;
			}
		</style>
</head>
<body>
<div class="main_bar">
    <div id="login_form">
        <div class="title">
            学科竞赛成绩管理系统登录
        </div>
        <form>
            <div id="form_widget">
                <br>
                <input type="text" placeholder="请输入账号" id="name" class="txt" value="用户名" onfocus="this.value=''" onblur="if(this.value=='')this.value='用户名'"/>
                <br>
                <input type="password" placeholder="请输入密码" id="password" class="txt" value="password" onfocus="this.value=''" onblur="if(this.value=='')this.value='password'"/>
                <br>
                <div id="search_pass_link">
                    <a href="#">忘记密码？</a>
                </div>
                <input  type="button" onclick="login()" value="登录" class="btn" onmouseover="this.style.backgroundColor='#FF8D00'" onmouseout="this.style.backgroundColor='#FC5628'">
                <div id="register_link" align="center" class="btn" onmouseover="this.style.backgroundColor='#FF8D00'" onmouseout="this.style.backgroundColor='#FC5628'">
                    <a href="register.html">注册</a>
                </div>
                <br>
            </div>
        </form>
    </div>
</div>
</body>
<script type="text/javascript">
    var a=0;
    function login(){
        var name=$("#name").val();
        var password=$("#password").val();
        $.ajax({
            type: "get",                //传递方法
            url:"/login/check?" + "name=" + name + "&"+ "password=" + password,     //数据接口
            dataType:"json",          //数据格式
            success: function(data)     //如果接收成功执行以下
            {
                if(data){
                    location.href='Template.html'
                }else{
                    alert(00)
                }
            },
            error:function(data)//如果接收不成功执行以下
            {
            }
        });
    }
</script>
<script src="jquery-3.3.1.min.js"></script>
</html>
